﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Hardcodet.Scheduling;
namespace Paltop_.Controllers
{
    public class Schedule
    {
        private Scheduler scheduler = new Scheduler();
        public void createSchedule(DateTime start)
        {
           
            Job job = new Job("MRSSYNC");
            job.Run.From(start).Every.Days(60);
            scheduler.SubmitJob(job, OnJobExecution);
        }
        private void OnJobExecution(Job job)
        {
            Paltop_DatabaseLayer.PaltopDatabaseEntities pe = new Paltop_DatabaseLayer.PaltopDatabaseEntities();
            pe.clearDeleteList(60);
        }
    }
}